// 定义全局的指令或者过滤器 
import Vue from 'vue'

Vue.filter("dateFormat",(value)=>{
    if(!value) return ''
    // console.log(value)
    var week = ['周日','周一','周二','周三','周四','周五','周六']
    var time = new Date(value)
    var month = time.getMonth() + 1;
    var day = time.getDate() 
    var w = time.getDay()

    var today = new Date().getDate();
    var newday = week[w]
    if(today==day){
        newday = '今天'
    }else if(today+1==day){
        newday = '明天'
    }else if(today+2==day){
        newday = '后天'
    }
    return `${newday}${month}月${day}日`;
})